"use strict";
cc._RF.push(module, '76413AUlq5OvqVMxIM3GGcU', 'select');
// script/select.js

'use strict';

var global = require('global');
cc.Class({
	extends: cc.Component,

	properties: {
		btnnode: cc.Node,
		gamescene: cc.Prefab,
		qkcell: cc.Prefab
	},

	onLoad: function onLoad() {
		var _this = this;

		//生成关卡选择按钮
		this.creategk();
		cc.director.on('qkclick', function (e) {
			//e.detail : this._gkid
			cc.director.emit('qkselect', e.detail);
			_this.returnbtn();
		}, this);
		cc.log('selectpanel:global.gkjindu=' + global.gkjindu);
	},
	returnbtn: function returnbtn() {
		var _this2 = this;

		this.node.opacity = 0;
		cc.director.getScheduler().schedule(function () {
			_this2.node.x += 20;
		}, this, 1 / 64, 63);
	},
	creategk: function creategk() {
		for (var i = 14; i >= 1; i--) {
			var qkcell = cc.instantiate(this.qkcell);
			qkcell.parent = this.btnnode;
			cc.director.emit('qkcell', 15 - i);
		}
	}
	// update (dt) {},

});

cc._RF.pop();